-
Notifications
You must be signed in to change notification settings - Fork 4.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix: input control drag and box control change #25933
Fix: input control drag and box control change #25933
Conversation
@stokesman Haii! Just a heads up, the BoxControl components (using UnitControls) need That is... typing in |
427d1fa
to
79949f9
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
e801eed803d1b49be53d5b8b488db988c32516e3 This diff is kind of funky but(rebased/edited it and the diff is easier to read) I think the overall flow of the code is easier to understand now. The gist of it is to handle the parse of any entered value+unit sooner than was previously done (by the state reducer) and update state / propagate at the same time. Then all the state reducer has to do is pass it along.
79949f9
to
575ea9b
Compare
This comment has been minimized.
This comment has been minimized.
575ea9b
to
d6aec80
Compare
@stokesman Haiii! I just tested this out on my end. It looks like it's working very well! Tested drag interactions, "reset" interactions, intentionally going beyond min/max values via keyboard, and up/down arrows. I left a comment for something to resolve. Once that's done, I feel okay merging this in, and closing the PR I had: Note: I hope the the state handling/flow of these components can be improved in the future 🙏 . |
d6aec80
to
a326f56
Compare
@ItsJonQ, thanks for testing and reviewing!
I'm not sure if you're talking about the UnitControl changes or the general idea of using the focus status as part of state handling logic. If you'd prefer, I'd be glad to drop that UnitControl change (09a4127495dc66eea57b9e3a196e489c4d4fb35b) from this PR and make it into its own. I would think the old flow could be retained but still enable the new feature (changing units from a parse even when the value didn't change). |
@stokesman Oh, I'm talking about I think your UnitControl fix is great! Thank you for that 🙏 |
Hm... I'm really not sure what the PHP unit test may be failing. Once tests are green, then I'd be happy to merge this PR :) Thanks! |
- adds wasDirtyOnBlur and its use in syncing logic - removes a bit of lint
allows unit to change on parses even if parsed value is unchanged
a326f56
to
3f788c4
Compare
@ItsJonQ, rebased on master and 💚 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚀 from me! Thanks @stokesman for this update 🙏
As an alternative to #25913, adds some changes that fix the issues:
InputControl
's handling of blur commits 78a0e90Additionally, some minor enhancements:
Here's visual of what the UnitControl change enables:
How has this been tested?
Storybook and Wordpress 5.5.1
Types of changes
Bug fix
Checklist: